package com.operate.api.operate.custom.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.github.pagehelper.PageInfo;
import com.operate.api.app.user.domain.vo.AppUserLoginResVO;
import com.operate.api.app.user.domain.vo.AppUserPasswordVO;
import com.operate.api.app.user.domain.vo.AppUserSearchVO;
import com.operate.api.app.user.domain.vo.AppUserVO;
import com.operate.api.app.user.service.IAppUserService;
import com.operate.api.base.ApiIndex;
import com.operate.api.base.IDEntity;
import com.operate.api.base.R;
import com.operate.api.base.RestPage;
import com.operate.api.operate.dramas.domain.vo.*;
import com.operate.api.operate.dramas.service.IDramasService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api( tags = ApiIndex.CustomController)
@RequestMapping(value = "/api/operate/custom")
@RestController
@SaCheckLogin
public class CustomController {

    @Autowired
    private IAppUserService service;

    @ApiOperation(value = "查询客户（APP用户）列表")
    @GetMapping(value = "/list")
    public R<RestPage<List<AppUserVO>>> list(
            @ApiParam(value = "查询参数") @ModelAttribute AppUserSearchVO searchVO) {
        List<AppUserVO> list = service.getList(searchVO);
        RestPage restPage = new RestPage(new PageInfo(list), list);
        return new R(restPage);
    }



    @ApiOperation(value = "关闭青少年模式")
    @PostMapping(value = "/close_young")
    public R close_young(@ApiParam(value = "参数")  @RequestBody IDEntity idEntity) {
        service.close_young(idEntity);
        return new R();
    }




}